<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Main extends CI_Controller {

    function __construct() {
        parent::__construct();
         if ($this->session->userdata('login') == FALSE) {
            redirect('login');
        }
    }

    function index() {
       
        $this->load->model('menu_model');
        $this->load->model('logs_model');
        
        $data = array();
        $data['current'] = 'Home';
        $data['link'] = 'main';
        $data['menus'] = $this->menu_model->_load();
        $data['login_logs'] = $this->logs_model->_login();
        $data['record_logs'] = $this->logs_model->_record();
        $data['play_logs'] = $this->logs_model->_play();
        
        $this->load->view('main-view',$data);
    }
    
      
}
?>